package com.docmanage.am.service.impl;

import com.docmanage.am.domain.AmCodeSerial;
import com.docmanage.am.mapper.AmCodeSerialMapper;
import com.docmanage.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 档案编码规则Service业务层处理
 * 
 * @author pointLion
 * @date 2023-06-18
 */
@Service
public class AmCodeSerialService
{
    @Autowired
    private AmCodeSerialMapper amCodeSerialMapper;

    /**
     * 查询档案编码规则
     * 
     * @param id 档案编码规则主键
     * @return 档案编码规则
     */
    public AmCodeSerial selectAmCodeSerialById(Long id)
    {
        return amCodeSerialMapper.selectAmCodeSerialById(id);
    }

    /**
     * 查询档案编码规则列表
     * 
     * @param amCodeSerial 档案编码规则
     * @return 档案编码规则
     */
    public List<AmCodeSerial> selectAmCodeSerialList(AmCodeSerial amCodeSerial)
    {
        //amCodeSerial.setTenantId(SecurityUtils.getTenantId());
        return amCodeSerialMapper.selectAmCodeSerialList(amCodeSerial);
    }

    /**
     * 新增档案编码规则
     * 
     * @param amCodeSerial 档案编码规则
     * @return 结果
     */
    public int insertAmCodeSerial(AmCodeSerial amCodeSerial)
    {
        //amCodeSerial.setTenantId(SecurityUtils.getTenantId());
        return amCodeSerialMapper.insertAmCodeSerial(amCodeSerial);
    }

    /**
     * 修改档案编码规则
     * 
     * @param amCodeSerial 档案编码规则
     * @return 结果
     */
    public int updateAmCodeSerial(AmCodeSerial amCodeSerial)
    {
        return amCodeSerialMapper.updateAmCodeSerial(amCodeSerial);
    }

    /**
     * 批量删除档案编码规则
     * 
     * @param ids 需要删除的档案编码规则主键
     * @return 结果
     */
    public int deleteAmCodeSerialByIds(Long[] ids)
    {
        return amCodeSerialMapper.deleteAmCodeSerialByIds(ids);
    }

    /**
     * 删除档案编码规则信息
     * 
     * @param id 档案编码规则主键
     * @return 结果
     */
    public int deleteAmCodeSerialById(Long id)
    {
        return amCodeSerialMapper.deleteAmCodeSerialById(id);
    }
}
